2fb90b6c3b79a4974a5b1a74faeb10e3be81792e
[openwrt/openwrt.git] /
1 From 4a7843cc8a41b9612becccc07715ed017770eb89 Mon Sep 17 00:00:00 2001
2 From: Lorenzo Bianconi <lorenzo@kernel.org>
3 Date: Tue, 6 May 2025 18:56:47 +0200
4 Subject: [PATCH] net: airoha: Add missing field to ppe_mbox_data struct
5
6 The official Airoha EN7581 firmware requires adding max_packet field in
7 ppe_mbox_data struct while the unofficial one used to develop the Airoha
8 EN7581 flowtable support does not require this field.
9 This patch does not introduce any real backwards compatible issue since
10 EN7581 fw is not publicly available in linux-firmware or other
11 repositories (e.g. OpenWrt) yet and the official fw version will use this
12 new layout. For this reason this change needs to be backported.
13 Moreover, make explicit the padding added by the compiler introducing
14 the rsv array in init_info struct.
15 At the same time use u32 instead of int for init_info and set_info
16 struct definitions in ppe_mbox_data struct.
17
18 Fixes: 23290c7bc190d ("net: airoha: Introduce Airoha NPU support")
19 Reviewed-by: Simon Horman <horms@kernel.org>
20 Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
21 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
22 Link: https://patch.msgid.link/20250506-airoha-en7581-fix-ppe_mbox_data-v5-1-29cabed6864d@kernel.org
23 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
24 ---
25 drivers/net/ethernet/airoha/airoha_npu.c | 10 ++++++----
26 1 file changed, 6 insertions(+), 4 deletions(-)
27
28 --- a/drivers/net/ethernet/airoha/airoha_npu.c
29 +++ b/drivers/net/ethernet/airoha/airoha_npu.c
30 @@ -104,12 +104,14 @@ struct ppe_mbox_data {
31 u8 xpon_hal_api;
32 u8 wan_xsi;
33 u8 ct_joyme4;
34 - int ppe_type;
35 - int wan_mode;
36 - int wan_sel;
37 + u8 max_packet;
38 + u8 rsv[3];
39 + u32 ppe_type;
40 + u32 wan_mode;
41 + u32 wan_sel;
42 } init_info;
43 struct {
44 - int func_id;
45 + u32 func_id;
46 u32 size;
47 u32 data;
48 } set_info;